﻿/** \file
* \par Subversion URL:
* \$URL: http://planar-rendering.googlecode.com/svn/trunk/frontend/src/Context.cs $
* \version \$Rev: 74 $
* \date    \$Date: 2009-04-20 01:12:01 +0000 (Mon, 20 Apr 2009) $
*/

using System;
using System.Runtime.InteropServices;

namespace Frontend
{
	/// <summary>
	/// Contains context for a fractal generation run.
	/// </summary>
	[StructLayout(LayoutKind.Sequential)]
	class Context
	{
		/// <summary>The maximum number of iterations.</summary>
		public int imax = 200;
		/// <summary>The index of the innermost parameter.</summary>
		public int pindex;
		/// <summary>The resolution of the innermost parameter.</summary>
		public int pres;
		/// <summary>The starting value of the innermost parameter.</summary>
		public double plow;
		/// <summary>The delta value of the innermost parameter.</summary>
		public double pdelta;

		/// <summary>
		/// Initialize parameters from a range.
		/// </summary>
		/// <param name="range">The innermost range.</param>
		public void InitParam(Range range)
		{
			pres = range.res;
			plow = range.low;
			pdelta = range.delta;
		}
	}
}
